#ifndef MEASURER_H

#define MEASURER_H
#include <cmath>
#include <vector>

#include "ProSpace.h"
#include "Measurer_Node.h"
#include "CodeGenerator.h"
class Measurer{
private:	
	static Measurer_Node *myNode;
	static int count;
	Measurer();
	static vector<float> partitions;
	static float conditionEntropy();
	static void jointSpace(vector<ProSpace> sp, vector<ProSpace>sp2,vector<ProSpace>& jntSpace);
	static void getOriginalProb(string varname);
	static void adjustProSpace(string varname);
	static Measurer_Node* getChildNode();
	static vector <ProSpace> adj;
	static vector <ProSpace> org;
	static vector<ProSpace> adj2;
	
	
public:
	static Measurer_Node *root;

	static void addToRoot(ProSpace* space);
	static float measureEntropy(string varname);
	static void updateTmpValue(int value, int op);
	static void updateTmpValue(string varname, int op);	
	static void updateByTmp(string from, string to);
	static void updateByTmp(string varname);	
	static void updateNodeByChild();
	static void addPartition(float weight);
	static ProSpace& output(const string varname);
	static ProSpace& output(const int index);
	static void addLeftChildNode(ProSpace* space);
	static void addRightChildNode(ProSpace* space);
	static void updateLeftNode();
	static void updateRightNode();
	static void updateParent();

};
#endif